const Base = require('../../base.js');

module.exports = class extends Base {
  async indexAction() {
    let id = this.get('id')
    /// 获取任务回复
    const task_result_db = this.mongoose('mongo/task_result')
    let task_result = await task_result_db.findOne(think.objId(id))
    /// 获取关联用户
    const users_db = this.mongoose('mongo/users')
    let users = await users_db.findOne(think.objId(task_result.uid))
    /// 获取关联任务
    const task_db = this.mongoose('mongo/task')
    let task = await task_db.findOne(think.objId(task_result.tid))
    /// 返回结果
    this.json({
      status: 200,
      message: 'success',
      data: {
        result: task_result, users, task
      }
    })
  }
};
